fix #1 by splitting out creating context