#1: Code refactory