Did some code cleanup