- code cleanup
- added licence headers