minor cleanups to mappnig code