Re-organize code to follow an inheritance approach.