Cleaning up nav target JS code