clean up parsing code
basic client