Added a test and removed a obsolete function in the service