cleaned up services and added tests