[Pending review] Payment refactoring

Merge this after #191 #188