Refactored Type system