Resolved circular dependency between model <=> model.database