Clean up the code slightly