Added nodemon and refactored some code