logic improements