moving parser to lib