Improve rotation function
remove unnecessary type hint