DIAG: filter valid points earlier

This saves us some code duplication.
Improve code prettiness