Refactor response to be data structure