Refactored MainApp And OutputProcessor Code