made changes to use inheritance instead of marker enum for classes