refactored parsing process to avoid recursive parsing of inner classes