Some refactoring v0.2