Add refactored code