Inline lodash find index and do some refactoring

This fixes #5