refactoring wp-node