Initial refactor of page state