Create a separate function that takes a filename and returns the extension, move to file model.