Clean up the code some