Refactored show selected question code