CLI cleanup
Reorganized source code