optimize file extension test