porting code to class system
porting code to class system