moved response building from handler to ResponseFactory