simplified replicated code
Merge commit '063001364770d958c0b4003945484cbcbbaad2e1'