Cleanup

Optimizes isArray and cleans up some code