refactored to better accommodate page path in code