Changed load() to dynamically chose function

Setting function dynamically chosen according to the attribute.