Refactored response parser