Added Exception throwing when not a valid number range
Refactored redundant code
Added Logging and Exception to signal to the user the error
Added IllegalArgumentException to signal error to the user