use when, fix hlint