refactored response