use constants
use local var for duplicate calculation.