refactored classifier