Moved flags to context object.