main motherboard code cleanup