clean up selecting nodes and edges; use model attr instead of css class