Refactored to accommodate implementation of Layer 2.