clean metric code