Code redundancy fixed