Cleaning up the code for merge