refactoring sizing algorithms