Removed unused code, simplified, PMD.