critical fix, this function must not be inlined
cleanup of unused/dead code