Inline doc updates and minor optimization