Remove more duplicates and change to using pick method from stdlib as it removes all the ugly if undef statements