some cleanup, added simple test