Added caching parser and separated from parser implementation.