Refined code.