Refactored code, set up for deploying to production