reduce num of clones, change switching logic