If I were a beginner I'd refactor it to look like this