Made optimization optional