refactor db.execute()