refactor into a page based layout