Make helper functions private
Use more specific names for accumulators
Use more core functions
Use threading macro whenever it improves readability
Improve on naming and remove unnecessary small function
Move helpers near the functions that use them