refactored code to use Student base class