WICKET-5518 simplified exception handling
Optimize imports and code formatting.

It seems Eclipse code formatting is totally broken at the moment.