Refactoring of types
Add write rules