collect helper functions into helper.cpp/.h