divide one step filtering

This is not good implementation,
because of extern and static variables.