update vm usage on hash key, add more type constraints in macros