Refactored Lda* model code.