optimize BRF,BR into BRT where possible