v0.2 A lot of refactoring