some cleanup, a lot more needed