Cleaned up fragment rotation logic