Refactoring after watching solution videos.