Adds Pattern Matching Logic for serialization and desearialization