Minor cosmetic changes
Refactored to remove side effects in map expression (was collect expression)
Refactored to remove use of foreach
Reverted code change
Refactored foreach loop
Refactored, replaced case with fold for checking Option value