refactor node to generic