refactoring web service