Tidy up markSelected method