clean up parser and cabac functions