Refactor the put method so that it's possible to send in-memory data.