implement cleanup functionality - closes issue #5