code refactoring for jnodeInserted/knodeInserted