refactor add page code to paths model