Doc update and refactor fix