improve downcode