Removing redundant prepare statements