Added WResponse and code reorganized