Refactor reverse integer