refactor project structure to extract libraries