optimize flags a little