wal: code cleanup