move bool logic to util
fix inf.t