Refactoring a bit. Starting work on nodes