Fix remove duplicated code
Fix support type query of instance of Entry