Moved forwarding and redirecting into a separate class.