Refactor payments controller