Replaced some magic numbers with constants.