remove Code redundancy