speed up compilation

set some parameters at run-time instead of at compile time to avoid huge
template code explosion
avoid some warnings