cleanup; update message output logic