minor refacoting
separated the node class into a file
updated comment & refactoring