Enhanced formatting rules.
Minor refactoring.