Handles transitions between screens