TODO: Add the resetting of internal structures.