Moved building of JS-Array from template to module