cleaned up loader.js