Improved routing by preprocessing filenames