refactor express middleware requires