Refactorying for code about indentation using tab key