Initializes arrays explicitely, improves and reformats JS code