improved hash and model