Add todos
Remove unused function
Write cmd output to stdout on return