Refactoring coil to use request and response classes