refact caos anneling