refact the structure