added helper_functions, moved small functions to that file.