refactored back-end variables that determine page