cleanup, added tests