refactored using Person class