static some things, const some things, remove some dead code some things