Refactoring to use restify.