Some refactoring - V0.2 complete