refactoring course purchasing process, adding some stricter validations