fix import and optimization on dict