exposed parsing and Main functionos