refactor and change organization of char-init