Uses inner listener class.