Several improvements, tests and refactorings Iteration 9.