Move file opening to "main" from parser