The code is refactored.