Refactors for simpler modularity allowed by browserify