using trait in place of class