refactored openstack adapter and added more tests