Get rid of preprocessor commands and use config flags instead. Slight bit more overhead, but easier coding. Also pass class pointers around instead of long lists of variables.