major code optimization.