Prefabrication of control cabinets