crazy-ass refactor, logic.js test passes, need to fix user.js test