Refactor out magic numbers