rewrite controller so that page parameters can be easily retrieved