Cleaning up the code and disabling debug mode