Adding node stubs; minor refactoring