refactor cli logic into seperate module