Pass only the id type to the functions and fix test_hierarchical