major refactoring for release