Refactoring
Type
add additional check to 'isNumber' function to identify 'instanceof Number' as a number