refact some files