Feature/refactor

Refactor seems ready.