Replace magic numbers with global constants