move helpers into modules wherever possible