Refactoring of ThrowIfNumberIsNegative method.