needed in treemap, moving it from there to core makes it reusable