finalize class