code design, add global cacheing