Refactor token class.