Start refactoring to v3.
A large piece of improvements and refactoring :gem: