renaming
close properly; add tests for 3 kinds of payload