refactory hash on router