Better imports, more error handling