refactor to normalize response object creation