optimize zwave model