Refactor parser to use entity class.