Refactor the tokenisation