Use hash to replace ostruct