general code cleanup