optimize the execute logic.