constness, use bool for booleans, and dead code removal
use bool instead of bitfield