simplifying interface to infer file type