Remove upvalues to save meomory cost for classes