Removing unnecessary commands