1. change structure of code, isolating parser from core logic
2. add unittest