extract logic from proxycontroller into other roles to enable easy customization.