Reduce some code duplication

Adds underscore as a dependency