Refactoring to eliminate phpmd warning messages