Fixing previous refactor. Adding some licence.