changing some map, filter, lambda back to more standard format for maintainability