Refactoring; getting lamdas working, getting context and context stack working