refactor of get/setOption