- refactored code