use helper function in main app