cleanup, docs and improvments