refactoring of the node apps