chains factory sets up chains for a text