cleanup ack code.