Put all JS for editing a payment into an object. #1190