Remove duplicate code

This is due to due to ae97b50af2d4765322aa8ccb0a2399a5e4c26d7d which is an improved version of 444b40ab3378a888708d858c3a7c273c8ee6ed4e