Make this private[spark] and move it to a separate file, Page.scala