Code refactory