refactor setting of default values