Refactor typeManager(delete unnecessary codes etc.)