switch trait to abstract class

thanks @xuwei-k