work on cleanup modes and examples/tests