[DEV] Rework the library to support multiple instance (step 2)