Refactor dropdown component