Confusing wiring

BorrisTheCat did not come out and say it, so I will - YOU ARE RISKING A SHORT AND PERHAPS A FIRE! You need to to solder or wire-nut the wires to a jumper, and ONLY the jumper goes to the device. If the box is too small, then you need a deeper box.

There are no "good enough" jobs in wiring, there is "per code" and there is "certain death", with no middle ground. I am only exaggerating a tiny bit here.

Where do the extra wires go? Most often to a wall outlet (or even just half a duplex outlet, a single plug) to allow lamps to be controlled by the same switch. You may want to check.