refactor generate token with concern