improve similar snippests