using classes as optimization