add clean image command
code refactor