added new types and refactoring