added element chaining method and context management