Reorganized source code