refactoring webservice call