consolidate middleware require