Clean up the cod for set target <-> view mapping