Refactoring and error correction.