Code cleanup. Documentation.