performance improvements via precompiling and pattern object