optimize: Generalizing the classification API a bit
merge