add generic functions to the controller, needs more work