style improvements
replace heterogeneous array with hash