optimize, build context as parameter.