replace dead code with minor preparations