Refactoring to cache classes, removed unused ints

Removed unused fields in every class.