Split the create parser object and parse file to two functions (constructor and method), to make it easier for me to debug memory leak.