Documentation cleanup, variable refactoring