Script enqueuing improved