Move library code out from data folder