move extracting title from file name to own method