Refactoriza utilizando HttpFoundation component.