refactor passing response to Response class