some general code cleanup