refactor prime module (delete if)