cleaned up files and added some error handling to adapters