rearrange local-apply ack logic