Controller functions moved into a service, changed function names