code generalization in order to support "previous" page link