better variable handling in code blocks