Cleaning up the code further