Better class extension.
Minor refactoring.