Refactoring code -LR