Use composition library where possible
Remove duplication between Type#update and Type#insert

The solution is also ugly but a good intermediate before next
refactoring cycle that adds Operation classes is done.