Refactored jsonToHash() in planCtrl.js