move command functions into separate source units
restructure source code