Changed output filenames creation logic