refactor need not to use if
refactor need not to use if