refact: add $.reduce fn to lumpy and refact some code