refactor token generation
add message types