core refacroring