Avoiding code duplication: Reusing insertion function.