Refactor node app