replace db calls with db.model calls