Refactored particle filter for DBN