refactor to allow for set functions