Removed duplicate bits of code.