Code cleanup. Updated docs