isaacs: any optimizations for this? https://gist.github.com/2989972