prmitive impl and refactoring