fix many bugs
refact the parse mechanism