more logical code handling