rest refact