Code refactoring to parse more files