Handles modes, all types of modes
Removed local fragment