more optimizations, simplified tabnew, new mappings