Minor code duplication removed

see title