Separted view and logic for the where command