refactored parsing into parser classes