[Issue #2] smart file type detection for factories