Major upgrade

Refactoring core libraries