first working version after restructuring into vendor lib