refactoring represent and overriding express send