minor cleanup of getting and checking filename ext