refactoring; recursive status filtering