Removed code duplication and 4 new violations (use of e.printStackTrace()) introduced in previous commit [d3dce19].