Use logical AND to avoid NPE
Setup improvements. Extract quietly