First refactoring effort.