refactor putEntry