extract magic numbers as constants and adjust values