code cleanup. ready for production