Refactoring and Web service implementation