working on page controller refacoter