using function controller instead of class