Refactor classifier