clean up commends and logging