code optimizations for extensibility