Do not put complicated expressions as first form in the threading macro
Use `merge` instead of `union` for combining maps
Use already defined functions to write more understandable code
Fix code alignment
Reduce code duplication where meaningful