moved utility functions to character flie