COde refcatoring