refactoring: remove useless if