refatoring the pages