move diagnostic message into a separate class