Refactored/reformatted code to comply with the node expectations