changed context to be use attributes instead of a dict