Message refactoring, stm messages and the particle filter