add is for isPrimary, move abstract class to a trait