Remove array usage in freevar implementations / immutable approach instead using ad-hoc list