refactor payment