parser and clean up