move middleware to "role" based service discovery