Closed #3588: Refactoring Array clear function

Refactoring Array clear function