Moved functionality methods to a controller