redisigned class structure