Removed redundant logic fork.
When the 2nd argument of `insertBefore` is null, it is analogous to `appendChild`