refactor according to carcassone work