Refactored code 2/2