Refactoring preparations for v2 release