move component_fn to module