low level functions to clean the atlas