replace tab handling
better dictionary cleanup