clean up command implemtation