avoiding array push to prevent allocation