extract reference generater to core