Minor refactoring and doc update.