some cleanups to work with new API