refactoring - more readable poj 1113