using shared ptr and class design