Code and logic refactoring.