Remove lodash dependency and clean up