Rework/simplify node code