refactored character methods from tokenizer to character