Simplified with the help of @dpo.