Improved loader with optional folder functionality