refact dee core code