Speedup drawing via moving from draw to draw_function