I've extracted a bunch of constants for regular expressions and data structures that will be immutable.