Updated swith statment to object hash