Attempt to fix loading issues
Clean up code