A bit of refactoring of Main.java so the old tests work