refactor response