Moved the logic for the wmem update to a separate process.