Refactor code a bit.

Start using underscore for collection based operations.