refactor events for payment