Dev Removed several occurences of raw SQL.