improved class design