Refactor code for finding page configuration files