refactored code for web service consumers