removed dead code, shortened finalize