simplified decorated-snippet api, added unit-test.