Refactoring to use SOAP