[bin] fix a bug in default template declaration
[lib] improve state output
[doc] better examples, basic and advanced usage