TODO note on performance optimization.