[Refactoring] Packed some lines of codes.