Code refactoring and restyling.