first phase of sperating library from data