Moved loader plugin from main to a separate file