Consolidate decoder code by introducing prepare_filter_node().