Improve rotation handling