updated docs and code cleanup