Code duplication eliminated with inheritance.