Refatorized functions on payments