Refactor parser as separate file
Removing global variable for testing