code refactoring and mongohq