Turned ResponseHandler class into a nested class to reduce redundancy