made manager class for library bundle and restructurize code