Cleaning up of code