better code handling