move parsing related methods into own class