Reorganize source code