Refactored using objects.