allow passing anonymous function to registerController