Refined code