code refactoring - updated Person class