refactoring with express