improved control panel, general code cleanup