refactored tokenize_connection and inverse into utility functions