Prime factors kata refactor