Refactored to satisfy PMD