decode as class def