Refactored Request handler