Refactored selected items view directive