Move Dime logic into packages