run make controller with a function instead of in the class constructor