move around javascript objects to meet review requirements of mozilla