Refactoring according pmd.