use hash to replace ostruct