make it slightly more generalized by removing magic numbers.