Updating header docs and minor optimization.