refactored onClick in dialog listener into separate methods to clean things up