refactor setting implementation