[Incomplete] move domain logic to where it should be