Cleans up the code