class design improved