Use less abstract data structures

* Avoid generic types
* Use simple approach to identify nodes (int)