Refactor v2

Bunch of changes.