change snippet strategy to be more flexible