Refactor isBlank method