Replacing inheritance with mixing. Code restructured.