factor out classifier