Replace return value of type() with call to the function

The comments beside the magic numbers were a smell to me and I think that clarity is better than a couple of function calls.