extract a private method to convert the input to boolean