write routine for injecting core elements