Replace magic numbers with constants

This is a suggestion that does not make any major change in the code.
By accepting this, the code is more readable for future maintainers.