Client side refactoring with MEAN.JS influence