Refactor sources into several sub-projects