Refactored webservice