cleanup and avoid deprecation warning