Re-organize helpers and move private functions at bottom