cleaner implementation of highlighting using delegate