Code optimize

- Used ruby prime? method