Source code classifier refactoring

It would be even better with the use of `TypeWithDefinition` active patterns.