Clean up the code