refactoring and removing redundant type info