changing project structure, moving functions to library