Implement TokenFactory

And comments here and there