refactoring: remove unused code and add 'name' to contexts