refactored filtering of questions