Licence, some refactoring.