basic refactor using prime
first commit after refactor