Refactored Naive Bayes