refactoring of parse contect and fixes for functions with variables as argument