Code refatoring