refactored id generation and entity and association type management
refactoring