Simplify GET/POST handling logic