refactoring towards more modularization
continue breakout of commands in separate plugin modules
fixed some bugs