modularized the rotate & crop