Integrating ws code