better filtering of output