move pages_load to framework/functions