refactored magic numbers