Did some general code cleanup