Refactoring, replaced magic numbers with constants.