separate middleware and routes into separate modules