new more efficient version taht also detects "unhandled" defines