licences and refactor