Refactor the token class