Code cleanup in particle demo