[WIP] Refactored to model

This depends on "refactored to base" PR and I need to check that this actually works.