Further refactor to remove enum types for elements and connections