Optimized loader code, cleaned up project