Refactor payment task