refact many things