improve and test snippet output