refactored code to include node class, edited css and actions accordingly