Clean up page finding code, also closes #45