change class to trait