cleaning up code, ready for production