make getPreviousToken a private method