refactor prime factors page