before refact