Code changes required to move to apache

This pull request is not merging. Only for review to see all changes are fine.