#3938 refactor