refactoring, dynamically-computed size