Refactoring and beautification.