Implemented simple filtering.
Small cleanups in the code.