Command code clean up