removes dist, updates opts and layeropts