Moved to a much faster method for resetting the context