move component functions to the helper file