Code refining