Is there a better approach to get the file extension (maybe passed through)?