Add code for proper snippet loading and clean-ups