split pages management js into two files