refactored payment stuff