Refactoring payment process