fix undefined operation
remove unneeded typedef