Some more refactoring in Model.pm