tiny formatting cleanup
small cleanup: avoid code duplication
improve exception message
fix indentation
revert fix for #189: caused an IndexOutOfBoundsException in Polish regression tests