WIP: clean up of PR 134

Still need to add tests, docs, etc.