refactor obj response and generate functionality