clean code

Removed some unnecessary cast and Array creation.
:angel:  All test  passed