Conver to class-based