Adding hook system. Reorganized to make this make sense.