reorganize code to have parser component