improving variable expansion