move boilerplate into base controller