split response and request handling into seperate methods