main class accepts an optional token