Add Patterns model and parsing