Changed node constructors to remove some code duplication