refactoring code while reading POODiR