refactoring magic numbers to constants