The rails are just a convience for installing.

You can remove the assembly thru the light hole to gain access to the junction box.