snippet best practice