Small refactor of the calcSize method