Refactoring: simplify few lines of code.