Improve callback mechanism and add demo for bang.