Refactor "reverse integer".