Refactored let to remove val, fun.