Change the aggregate executor API and refactor related code