add some tests and extract parser namespace