Refactored dinodex based on Franco's comments