refactored Node to be an object prototype