refactoring webservices