define `resize_capa` as a function

This increases readability and maintainability,
and it also doesn't use reserved identifiers.