Rewrite Request class for improved testability