Refactored Model and added Node structure