refactor of the particle system