Refactoring: reduce RAM usage (12 byte variables were freed)