refactoring function definition parsing to account for free variable tracking, part 1