Refactor all models to use common base code.