code clean-up
implement simple filtering