Minor refactor of contexts