Removed nested script loading
Cleaned up code