refined code