Minor code cleanup and some Documentation