ASTTypeDiscovery.cpp needs a revamp. The current code is quite messy. It does the job, but needs a clean-up. This is low priority