Improve library and demo