Code refactored.