Refactor sizing functions