code restructure, added shell command feature