refactoring if with main call using node transformer