avoid NPE
refactoring
terminal