Simplify code

Avoid calling `Number(value)` twice and clean up the code a bit.

Ref. http://www.wirfs-brock.com/allen/posts/128
Merge pull request #1 from mathiasbynens/patch-1

Simplify code