separated js initialization