rework for chain helper function