Source code classifier refactoring

Again one should use `TypeWithDefinition` active patterns.