refactoring dropdown