refactored like a pro