renaming, code cleanup, added docs