Format and calculate idle stuff in lib