Moved dimension computation to library stats