code cleanup, ui restructuring