REFACTORED.