Further refactoring, seperate node class and base class to seperate files.