refactor set and get methods