Improve loading script