Minor refactoring & removing code warnings

for the rotate project